import settings
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import text

app = Flask(__name__)
app.config.from_object(settings.Dev)
db = SQLAlchemy(app)

with app.app_context():
    try:
        result = db.session.execute(text('SELECT 1'))
        print('数据库连接成功！')
    except Exception as e:
        print('数据库连接失败：', repr(e))